<div class="site-content">
  <div class="d-flex flex-md-row flex-items-center stafftools-page-header">
    <div class="col-1">
      <span class="assignment-icon assignment-icon-individual left">
        <%= octicon 'repo', height: 22 %>
      </span>
    </div>

    <div class="col-10 col-md-10 d-flex flex-column">
      <h2 class="stafftools-heading">
        <%= "#{t('views.stafftools.assignment_repos.assignment_repo')} #{@assignment_repo.id}" %>
      </h2>

      <p class="assignment-type text-gray"><%= t('views.stafftools.assignment_repos.assignment_repo_small') %></p>
    </div>
  </div>

  <div class="boxed-group">
    <h3><%= t('views.stafftools.assignment_repos.general_info') %></h3>

    <div class="boxed-group-inner">
      <table>
        <tr>
          <td class="text-emphasized"><%= t('views.stafftools.assignment_repos.id') %></td>
          <td><%= @assignment_repo.id %></td>
        </tr>
        <tr>
          <td class="text-emphasized"><%= t('views.stafftools.assignment_repos.owned_by') %></td>
          <td><%= link_to @assignment_repo.organization.title, stafftools_organization_path(@assignment_repo.organization.id) %></td>
        </tr>
        <tr>
          <td class="text-emphasized"><%= t('views.stafftools.assignment_repos.created_by') %></td>
          <td><%= link_to @assignment_repo.creator.github_user.login, stafftools_user_path(@assignment_repo.creator) %></td>
        </tr>
        <tr>
          <td class="text-emphasized"><%= t('views.stafftools.assignment_repos.assignment') %></td>
          <td><%= link_to @assignment_repo.assignment.title, stafftools_assignment_path(@assignment_repo.assignment.id) %></td>
        </tr>
        <tr>
          <td class="text-emphasized"><%= t('views.stafftools.assignment_repos.user') %></td>
          <td><%= link_to @assignment_repo.user.github_user.login, stafftools_user_path(@assignment_repo.user) %></td>
        </tr>
        <tr>
          <td class="text-emphasized"><%= t('views.stafftools.assignment_repos.created_on') %></td>
          <td><%= local_time(@assignment_repo.created_at) %></td>
        </tr>
      </table>
    </div>
  </div>

  <div class="boxed-group">
    <h3><%= t('views.stafftools.assignment_repos.github_repo') %></h3>
    <div class="boxed-group-inner">
      <table>
        <tr>
          <td class="text-emphasized"><%= t('views.stafftools.assignment_repos.repo_id') %></td>
          <td><%= @assignment_repo.github_repo_id %></td>
        </tr>
        <tr>
          <td class="text-emphasized"><%= t('views.stafftools.assignment_repos.source_code') %></td>
          <td><%= link_to @assignment_repo.github_repository.html_url, @assignment_repo.github_repository.html_url %></td>
        </tr>
      </table>
    </div>
  </div>

  <div class="boxed-group dangerzone">
    <h3><%= t('views.stafftools.assignment_repos.dangerzone') %></h3>

    <div class="boxed-group-inner">
      <p>
        <a data-remodal-target="delete-assignment-repo" class="btn btn-danger"><%= t('views.stafftools.assignment_repos.delete_repo_title') %></a>
      </p>

      <div class="remodal text-left" data-remodal-id="delete-assignment-repo">
        <button data-remodal-action="close" class="remodal-close"><%= octicon 'x' %></button>
        <h2 class="remodal-header"><%= t('views.stafftools.assignment_repos.delete_repo_confirmation') %></h2>

        <div class="remodal-warning"><%= t('views.stafftools.assignment_repos.delete_repo_warning') %></div>

        <div class="remodal-description">
          <p><%= raw t('views.stafftools.assignment_repos.delete_repo_desc') %></p>
        </div>

        <%= form_for @assignment_repo, url: stafftools_assignment_repo_path(@assignment_repo), html: { "data-name" => @assignment_repo.id, method: 'delete' } do |f| %>
          <dl class="form js-normalize-submit">
            <dt><%= t('views.stafftools.assignment_repos.repo_id_confirmation', assignment_repo_id: @assignment_repo.id) %></dt>
            <dd><input type="text" class="js-input-block form-control input-contrast input-block" autofocus></dd>
          </dl>

          <%= f.submit t('views.stafftools.assignment_repos.delete_repo_link_text'), class: 'btn btn-danger btn-block js-submit', disabled: true %>
        <% end %>
      </div>
    </div>
  </div>
</div>
